(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

h(c(x, y), c(s(z), z), t(w)) → h(z, c(y, x), t(t(c(x, c(y, t(w))))))
h(x, c(y, z), t(w)) → h(c(s(y), x), z, t(c(t(w), w)))
h(c(s(x), c(s(0), y)), z, t(x)) → h(y, c(s(0), c(x, z)), t(t(c(x, s(x)))))
t(t(x)) → t(c(t(x), x))
t(x) → x
t(x) → c(0, c(0, c(0, c(0, c(0, x)))))

Rewrite Strategy: INNERMOST

(1) DependencyGraphProof (BOTH BOUNDS(ID, ID) transformation)

The following rules are not reachable from basic terms in the dependency graph and can be removed:
h(c(x, y), c(s(z), z), t(w)) → h(z, c(y, x), t(t(c(x, c(y, t(w))))))
h(x, c(y, z), t(w)) → h(c(s(y), x), z, t(c(t(w), w)))
h(c(s(x), c(s(0), y)), z, t(x)) → h(y, c(s(0), c(x, z)), t(t(c(x, s(x)))))
t(t(x)) → t(c(t(x), x))

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

t(x) → c(0, c(0, c(0, c(0, c(0, x)))))
t(x) → x

Rewrite Strategy: INNERMOST

(3) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(4) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

t(x) → c(0, c(0, c(0, c(0, c(0, x))))) [1]
t(x) → x [1]

Rewrite Strategy: INNERMOST

(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(6) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

t(x) → c(0, c(0, c(0, c(0, c(0, x))))) [1]
t(x) → x [1]

The TRS has the following type information:
t :: c → c
c :: 0 → c → c
0 :: 0

Rewrite Strategy: INNERMOST

(7) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:
none

And the following fresh constants:

const

(8) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

t(x) → c(0, c(0, c(0, c(0, c(0, x))))) [1]
t(x) → x [1]

The TRS has the following type information:
t :: c → c
c :: 0 → c → c
0 :: 0
const :: c

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

0 => 0
const => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

t(z) -{ 1 }→ x :|: x >= 0, z = x
t(z) -{ 1 }→ 1 + 0 + (1 + 0 + (1 + 0 + (1 + 0 + (1 + 0 + x)))) :|: x >= 0, z = x

Only complete derivations are relevant for the runtime complexity.

(11) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V),0,[t(V, Out)],[V >= 0]).
eq(t(V, Out),1,[],[Out = 5 + V1,V1 >= 0,V = V1]).
eq(t(V, Out),1,[],[Out = V2,V2 >= 0,V = V2]).
input_output_vars(t(V,Out),[V],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. non_recursive : [t/2]
1. non_recursive : [start/1]

#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into t/2
1. SCC is partially evaluated into start/1

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations t/2
* CE 4 is refined into CE [5]
* CE 3 is refined into CE [6]


### Cost equations --> "Loop" of t/2
* CEs [5] --> Loop 4
* CEs [6] --> Loop 5

### Ranking functions of CR t(V,Out)

#### Partial ranking functions of CR t(V,Out)


### Specialization of cost equations start/1
* CE 2 is refined into CE [7,8]


### Cost equations --> "Loop" of start/1
* CEs [7,8] --> Loop 6

### Ranking functions of CR start(V)

#### Partial ranking functions of CR start(V)


Computing Bounds
=====================================

#### Cost of chains of t(V,Out):
* Chain [5]: 1
with precondition: [V+5=Out,V>=0]

* Chain [4]: 1
with precondition: [V=Out,V>=0]


#### Cost of chains of start(V):
* Chain [6]: 1
with precondition: [V>=0]


Closed-form bounds of start(V):
-------------------------------------
* Chain [6] with precondition: [V>=0]
- Upper bound: 1
- Complexity: constant

### Maximum cost of start(V): 1
Asymptotic class: constant
* Total analysis performed in 19 ms.

(12) BOUNDS(1, 1)